Improve SpikeGLX stream-collision error message#1831
Merged
h-mayorquin merged 2 commits intoNeuralEnsemble:masterfrom Apr 21, 2026
Merged
Improve SpikeGLX stream-collision error message#1831h-mayorquin merged 2 commits intoNeuralEnsemble:masterfrom
h-mayorquin merged 2 commits intoNeuralEnsemble:masterfrom
Conversation
alejoe91
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When two
.meta/.binpairs resolve to the same(seg_index, stream_name), the reader currently raises a bareKeyErrorthat names neither of the colliding files nor any of the causes. This same error has surfaced repeatedly across #1606, #1656, #1511, #1782, and for ome IBL files where thre was intentional tamper with the files. Users have no way to self-diagnose. This PR extracts a small helper,_build_signals_info_dict, that owns the dict construction and raises aValueErrornaming both colliding.metapaths and listing the four known causes. Behavior is unchanged on the happy path. I have kept the scope tight to the error message and the extraction that makes it unit-testable without.binfixtures, which the two new tests exercise directly.Before:
After:
This PR does not close any open issue. The underlying causes behind #1606, #1656, and #1782 are already fixed; the collision remains reachable for #1511 (mixed tcat/non-tcat) and the IBL case, and those require separate fixes. The value here is diagnostic: when any future collision occurs, users and maintainers get enough information to triage it from the traceback alone instead of filing another issue about the same terse
KeyError.